﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Studio.Network.Kaixin001.Entities
{
    public class Parking
    {

        public static readonly string[] COLOR_NAMES = new string[] { "白", "银", "灰", "红", "蓝", "黄" };

        public static readonly Color[] CAR_COLORS = new Color[] { Color.White, Color.Silver, Color.Gray, Color.Red, Color.Blue, Color.Yellow };

        public int parkid;
        public int car_uid;
        public int carid;
        public int ctime;
        public string car_real_name;
        public string car_logo20;
        public int car_isfriend;
        public string car_logo_big;
        public string car_logo_small;
        public string car_logo_flash;
        public string car_police;
        public int car_profit;

        public bool is_empty
        {
            get { return 0 == carid; }
        }

        public bool is_free
        {
            get 
            {
                // Decompiled from Flash
                return ((parkid >> 16) & 255) != 0;
            }
        }

        public int color_index
        {
            get
            {
                return (parkid & 65535) % COLOR_NAMES.Length;
            }
        }

        public Color free_color
        {
            get { return CAR_COLORS[color_index]; }
        }

        public string free_color_name
        {
            get { return COLOR_NAMES[color_index]; }
        }

    }
}
